package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.entity.BasMaterialCategory;
import io.finer.erp.jeecg.bas.entity.ZrkMesFqParam;
import io.finer.erp.jeecg.bas.mapper.ZrkMesFqParamMapper;
import io.finer.erp.jeecg.bas.service.IZrkMesFqParamService;
import io.finer.erp.jeecg.bas.vo.ZrkMesFqParamVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @Description: 分切参数表
 * @Author: jeecg-boot
 * @Date:   2020-12-24
 * @Version: V1.0
 */
@Service
public class ZrkMesFqParamServiceImpl extends ServiceImpl<ZrkMesFqParamMapper, ZrkMesFqParam> implements IZrkMesFqParamService {

    @Autowired
    private ZrkMesFqParamMapper zrkMesFqParamMapper;


    @Override
    public List<ZrkMesFqParamVO> selectParamBymesId(String mesId){
        List<ZrkMesFqParamVO> zrkMesFqParamVOS=zrkMesFqParamMapper.getParamByMesId(mesId);
        return zrkMesFqParamVOS;
    }
    @Override
    public List<ZrkMesFqParamVO> selectParamsByMesId(String mesId){
        List<ZrkMesFqParamVO> zrkMesFqParamVOS=zrkMesFqParamMapper.getParamByMesId(mesId);
        for (ZrkMesFqParamVO zrkMesFqParamVO : zrkMesFqParamVOS) {
           String s= zrkMesFqParamVO.getPartParam()+"="+zrkMesFqParamVO.getModel()+"*"+zrkMesFqParamVO.getQuantity();
           zrkMesFqParamVO.setPartParam(s);
        }
        return zrkMesFqParamVOS;
    }

}
